(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldf(x, nil) → x
foldf(x, cons(y, z)) → f(foldf(x, z), y)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, cons(C, c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldf(triple(cons(A, a), nil, c), b))
f''(triple(a, b, c)) → foldf(triple(a, b, nil), c)
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
foldf(x, cons(y, z)) →+ f(foldf(x, z), y)
gives rise to a decreasing loop by considering the right hand sides subterm at position [0].
The pumping substitution is [z / cons(y, z)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldf(x, nil) → x
foldf(x, cons(y, z)) → f(foldf(x, z), y)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, cons(C, c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldf(triple(cons(A, a), nil, c), b))
f''(triple(a, b, c)) → foldf(triple(a, b, nil), c)
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldf(x, nil) → x
foldf(x, cons(y, z)) → f(foldf(x, z), y)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, cons(C, c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldf(triple(cons(A, a), nil, c), b))
f''(triple(a, b, c)) → foldf(triple(a, b, nil), c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
foldf,
f,
f',
f''They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(8) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f, foldf, f', f''
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f.
(10) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f', foldf, f''
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(11) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f'.
(12) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f'', foldf
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f''.
(14) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
foldf
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
foldf(
triple(
nil,
nil,
nil),
gen_nil:cons4_0(
n182_0)) →
triple(
gen_nil:cons4_0(
n182_0),
gen_nil:cons4_0(
0),
gen_nil:cons4_0(
0)), rt ∈ Ω(1 + n182
0)
Induction Base:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(0)) →RΩ(1)
triple(nil, nil, nil)
Induction Step:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(+(n182_0, 1))) →RΩ(1)
f(foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)), A) →IH
f(triple(gen_nil:cons4_0(c183_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), A) →RΩ(1)
f'(triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), g(A)) →RΩ(1)
f'(triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), A) →RΩ(1)
f''(foldf(triple(cons(A, gen_nil:cons4_0(n182_0)), nil, gen_nil:cons4_0(0)), gen_nil:cons4_0(0))) →RΩ(1)
f''(triple(cons(A, gen_nil:cons4_0(n182_0)), nil, gen_nil:cons4_0(0))) →RΩ(1)
foldf(triple(cons(A, gen_nil:cons4_0(n182_0)), nil, nil), gen_nil:cons4_0(0)) →RΩ(1)
triple(cons(A, gen_nil:cons4_0(n182_0)), nil, nil)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(16) Complex Obligation (BEST)
(17) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f, f', f''
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(18) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f.
(19) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f', f''
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(20) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f'.
(21) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
f''
They will be analysed ascendingly in the following order:
foldf = f
foldf = f'
foldf = f''
f = f'
f = f''
f' = f''
(22) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol f''.
(23) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
(25) BOUNDS(n^1, INF)
(26) Obligation:
TRS:
Rules:
g(
A) →
Ag(
B) →
Ag(
B) →
Bg(
C) →
Ag(
C) →
Bg(
C) →
Cfoldf(
x,
nil) →
xfoldf(
x,
cons(
y,
z)) →
f(
foldf(
x,
z),
y)
f(
t,
x) →
f'(
t,
g(
x))
f'(
triple(
a,
b,
c),
C) →
triple(
a,
b,
cons(
C,
c))
f'(
triple(
a,
b,
c),
B) →
f(
triple(
a,
b,
c),
A)
f'(
triple(
a,
b,
c),
A) →
f''(
foldf(
triple(
cons(
A,
a),
nil,
c),
b))
f''(
triple(
a,
b,
c)) →
foldf(
triple(
a,
b,
nil),
c)
Types:
g :: A:B:C → A:B:C
A :: A:B:C
B :: A:B:C
C :: A:B:C
foldf :: triple → nil:cons → triple
nil :: nil:cons
cons :: A:B:C → nil:cons → nil:cons
f :: triple → A:B:C → triple
f' :: triple → A:B:C → triple
triple :: nil:cons → nil:cons → nil:cons → triple
f'' :: triple → triple
hole_A:B:C1_0 :: A:B:C
hole_triple2_0 :: triple
hole_nil:cons3_0 :: nil:cons
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(A, gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
foldf(triple(nil, nil, nil), gen_nil:cons4_0(n182_0)) → triple(gen_nil:cons4_0(n182_0), gen_nil:cons4_0(0), gen_nil:cons4_0(0)), rt ∈ Ω(1 + n1820)
(28) BOUNDS(n^1, INF)